home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15261 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  55 lines

  1. Newsgroups: comp.lang.c++
  2. Path: in1.uu.net!shore!mv!usenet
  3. From: ENGR@GSSI.MV.COM (Michael Furman)
  4. Subject: Re: Preprocessor derectives is insufficient for me
  5. Message-ID: <DpCEpL.Dtv@mv.mv.com>
  6. Mime-Version: 1.0
  7. Content-Type: Text/Plain; charset=US-ASCII
  8. Organization: GSSI
  9. Date: Thu, 4 Apr 1996 14:53:44 GMT
  10. References: <ABY08OnW53@npn-price.pskov.su>
  11. X-Newsreader: WinVN 0.99.7
  12. X-Nntp-Posting-Host: gssi.mv.com
  13.  
  14. In article <ABY08OnW53@npn-price.pskov.su>, ivl@npn-price.pskov.su says...
  15. >
  16. >Hello all!
  17. >
  18. >Just look at this code
  19. >
  20. >#define DECLARE_CLASS(first_class,second_class,name_class)     \
  21. >class name_class : virtual public first_class , virtual public second_class 
  22.     
  23. >\
  24. >{       \
  25. >public: \
  26. >        name_class();   \
  27. >        ~name_class();  \
  28. >public: \
  29. >        virtual base* operator&(classA&) \
  30. >        virtual base* operator&(classB&) \
  31. >
  32. >                . . .
  33. >
  34. >        virtual base* operators&(classN&) \
  35. >};
  36. >
  37. >I have to filter some operations I don't need in specific name_class.
  38. >But a compiler don't allow to use #if in another #define statement :(
  39. >
  40. >May be there is a way to solve my problem ?
  41.  
  42. You want to generate some C++ code automatically. C/C++ preprocessor
  43. was not designed for this kind of work. I would recommend you use some
  44. universal macroprocessor or just make your own generator.
  45.  
  46. -- 
  47. <<< If you received it by E-mail: it is a copy of post to the newsgroup >>>
  48. ---------------------------------------------------------------
  49. Michael Furman,                       (603)893-1109
  50. Geophysical Survey Systems, Inc.  fax:(603)889-3984
  51. 13 Klein Drive - P.O. Box 97          engr@gssi.mv.com 
  52. North Salem, NH 03073-0097            71543.1334@compuserve.com
  53. ---------------------------------------------------------------
  54.  
  55.